<style>
    #teachList tr >th,td {
        border: 1px solid #ddd;
    }
    body {
        /*background-color: #f9f9f9;*/
    }
    .teaTitle tr >th {
        text-align: center;
    }
    .grade {
        cursor:pointer;
    }
</style>
<table id="teaAndSchool" class="table table-hover">
    {% if type == 1 %}
        <tr width="100%" class="info" id="open_close" style="cursor: pointer;" title="点击展开/关闭学校详情">
            <th colspan="4">
                <i id="open_icon" class="fa fa-chevron-down" style="padding-right: 5px;cursor: pointer;" ></i>
                关联学校数量：{{ schoolNum }}
            </th>
        </tr>
        {% if schoolData is not empty %}
            {% for row in schoolData %}
                <tr class="schoolDetail" style="display: none">
                    <td>{{ row['sSchoolName'] }}</td>
                </tr>
            {% endfor %}
        {% endif %}
    {% else %}
        <tr width="100%" class="info" id="open_close" style="cursor: pointer;" title="点击展开/关闭学校详情">
            <th colspan="4">
                <i id="open_icon" class="fa fa-chevron-down" style="padding-right: 5px;cursor: pointer;" ></i>
                没有书本id，无法查询学校信息
            </th>
        </tr>
    {% endif %}
</table>
<table id="teachList" class="table table-hover">
    <tr class="info teaTitle">
        <th style="width: 25%;text-align: center;">老师</th>
        <th style="width: 25%;text-align: center;">书类型</th>
        <th style="width: 25%;text-align: center;">年级</th>
        <th style="width: 25%;text-align: center;">数量</th>
    </tr>
    {% if data is not empty %}
        {% for item in data %}
            <tr>
                {% if item['isTeaFirstRow'] == 1 %}
                    <td rowspan="{{ item['teaRowSpan'] }}">{{ item['teaName'] }}</td>
                {% endif %}
                {% if item['isBookRowSpan'] == 1 %}
                    <td rowspan="{{ item['bookRowSpan'] }}">{{ item['bookType'] }}</td>
                {% endif %}
                {% if item['grade'] is not empty %}
                    <td  class="grade" title="点击查看书本" id="{{ item['gradeId'] }}">{{ item['grade'] }}</td>
                {% else %}
                    <td>{{ item['grade'] }}</td>
                {% endif %}
                <td style="text-align: right;">{{ item['gradeNum'] }}</td>
            </tr>
        {% endfor %}
    {% endif %}
</table>